<?php
require('config/globalconfig.php');
include_once('classes/user_user.php');
$objUSer = new user_user($objConnection);
//user_common::writeLog('abc',0);
if($_pgR['act'] == user_user::ACT_LOGIN)
{
	$user_id = $_pgR['id'];
	$strPass = $_pgR['pass'];
	$result =  $objUSer->login($user_id,$strPass);
	//print_r($result);
	if ($result) 
	{
		
		$_SESSION[user_common::SES_C_USERINFO] = $result;
		//print_r($_SESSION[user_common::SES_C_USERINFO]);
		$_SESSION[user_common::SES_C_USERINFO]["active"]=1;
		echo user_common::convertToXML($strMessageHeader, array('rs'), array(1),array(0));
		return;
	}
	else
	{
		echo user_common::convertToXML($strMessageHeader, array('rs'), array(0),array(0));
		return;	
	}
	
}
elseif($_pgR['act'] == user_user::ACT_LOGOUT)
{
	$_SESSION[user_common::SES_C_USERINFO] = null;
	echo user_common::convertToXML($strMessageHeader, array('rs'), array(1),array(0));
	return;
}
require('include/_header.inc');
require('include/_menu.inc');
require('include/_footer.inc');
?>

